package com.bolt.admin.security.shiro.exception;

import com.bolt.admin.exception.BizExceptionEnum;
import com.bolt.convention.data.code.ServiceCode;
import org.apache.shiro.authc.AuthenticationException;

/**
 * Created by Administrator on 2018/11/26.
 */
public class AuthErrorException extends AuthenticationException {

    private String code;

    public String getCode() {
        return code;
    }

    public AuthErrorException() {
        super();
    }



    public AuthErrorException( ServiceCode serviceCode) {
        super(serviceCode.message());
        this.code = serviceCode.code();
    }
    public AuthErrorException(String code, String message) {
        super(message);
        this.code = code;
    }

    public AuthErrorException(String message, Throwable cause) {
        super(message, cause);
        this.code = BizExceptionEnum.UNKNOWN_ERROR.code();
    }

    public AuthErrorException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }
}
